<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 16:53:56
 * @LastEditTime: 2022-09-21 15:56:21
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Http\Services\System;


use App\Http\Services\Service;
use App\Repositories\TemporaryTokenRepository;

class TemporaryTokenService extends Service
    {
    public function __construct(TemporaryTokenRepository $repository)
        {
        $this->repository = $repository;
        }
    public function create()
        {
        return $this->repository->createToken(request("user_id", '0'));
        }
    public function userList()
        {
        return $this->repository->whereUser_id(auth()->user()->employee_id)->whereIs_system(0)->getGrid();
        }
    protected function userTokenDelete()
        {
        $this->repository->whereId(request()->input("id"))->first()->delete();
        return $this->userList();
        }
    }
